{% set clazz = "goods" %}
{% set title = "热门兑换" %}
{% extends './modules/common/templates/main.html' %}
{% block style %}
  <link rel="stylesheet" type="text/css" href="{{ '/static/css/integral.css'|version }}" />
{% endblock %}
{% block content %}
  {% if !nested %}
    <header class="bar bar-header">
      {{ macro.back() }}
      <h1 class="title">{{ title }}</h1>
    </header>
  {% endif %}
  <section>
    {% if list.length %}
      <div class="showcases">
        <div id="goods" class="content">
          {% for item in list %}
            <a class="item" href="/integral/details/{{ item.id }}">
              <div class="panel round">
                <div class="vspace hspace" ui-mode="20px">
                  <div class="autofix figure">
                    <img src="{{ item.coverImg|thumb(305, 305) }}" />
                  </div>
                  {% if item.isFinished %}
                    <img class="sellout" src="http://7xjyap.com2.z0.glb.qiniucdn.com/image-e23b028d-83f4-42d2-867b-f7a1a1f7fe8f.png" />
                  {% endif %}
                </div>
                <div class="text">
                  <h4 class="name text-ellipsis">{{ item.goodsName }}</h4>
                  <small class="brief">
                  积分：<i class="split text-orange">{{ item.consumeIntegral }}</i>
                </div>
              </div>
            </a>
          {% endfor %}
        </div>
      </div>
    {% else %}
      <div class="plate">
        <div class="draw">
          <img src="http://7xjyap.com2.z0.glb.qiniucdn.com/image-2f0df3ff-2a9a-4367-a7df-bd53231b0a9f.png" alt="空白" />
          <h4 class="title">暂时没有可以兑换的商品</h4>
        </div>
      </div>
    {% endif %}
  </section>
  {% raw %}
    <script id="goodsTempl" type="text/swig-template">
      {% for item in list %}
        <a class="item" href="/integral/details/{{ item.id }}">
          <div class="panel round">
            <div class="vspace hspace" ui-mode="20px">
              <div class="autofix figure">
                <img src="{{ item.coverImg|thumb(305, 305) }}" />
              </div>
              {% if item.isFinished %}
                <img class="sellout" src="http://7xjyap.com2.z0.glb.qiniucdn.com/image-e23b028d-83f4-42d2-867b-f7a1a1f7fe8f.png" />
              {% endif %}
            </div>
            <div class="text">
              <h4 class="name text-ellipsis">{{ item.goodsName }}</h4>
              <small class="brief">
              积分：<i class="split text-orange">{{ item.consumeIntegral }}</i>
            </div>
          </div>
        </a>
      {% endfor %}
    </script>
  {% endraw %}
{% endblock %}
{% block script %}
{% parent %}
<script src="{{ '/static/js/integral.js'|version }}"></script>
{% endblock %}